package dome5;
import java.util.Scanner;

public class Day0201 {
        public static void main(String[] args) {
            Scanner in = new Scanner(System.in);
            // 注意 hasNext 和 hasNextLine 的区别
            double a = in.nextDouble();;
            String b = in.next();
            char ch = b.charAt(0);
            int money = 20;
            if(ch == 'y') {
                money += 5;
            }
            if(a >= 1) {
                money += (maxWeight(a) - 1);
                System.out.println(money);
            }else if(a == 0){
                System.out.println(0);
            }else {
                System.out.println(money);
            }
        }

        private static int maxWeight(double num) {
            if(num % (int)num == 0) return (int)num;
            return (int)num + 1;
        }
}
